<? global $lg, $FullUrl, $notice; ?>
<div class="form-main">
	<form action="<?=$FullUrl?>/index.php?do=player&act=registersm" method="post" name="reg">
        <label>Account</label>
        <input type="text" name="username" id="username" value="" helper="formText" placeholder="Tài Khoản" maxlength="24"/>
        <br/>        
        <label>Mật khẩu</label>
        <input type="password" name="password" id="password" value="" helper="formPassword" placeholder="Mật Khẩu"/>
        <br/>
        <label>Mật khẩu (lặp lại)</label>
        <input type="password" name="repassword" id="repassword" value="" helper="formPassword" placeholder="Mật Khẩu"/>
        <br/>
        <label>Email</label>
        <input type="text" name="email" id="email" value="" helper="formText" placeholder="Email" maxlength="24"/>
        <br/>
        <label>CMND</label>
        <input type="text" name="cmnd" id="cmnd" value="" helper="formText" placeholder="CMND" maxlength="32"/>
        <br/>
        <?
        	$_SESSION['captcha'] = mt_rand(10000, 99999);
        ?>
        <div style="display:inline-block; width:350px; float:left;margin-left:200px;margin-bottom:10px;"> <img src="lib/Captcha/PHP-CAPTCHA/php_captcha.php"></div>
        <label>Kiểm tra:</label>
        <input type="text" name="number_captcha" id="code" value="" onfocus="if(this.value=='Mã kiểm tra') this.value=''" onblur="if(this.value=='') this.value='Mã kiểm tra'" value="Mã kiểm tra"/>
        <tr><?=isset($notice)?$notice:'';$notice = ''; ?></tr>
        <br/>
        <input value="&nbsp;" name=reg type="submit" class="reg_button" style="margin-left:125px;" onclick="return validateFormReg()">
      </form>
</div>   
<script type="text/javascript">
function validateFormReg()
{
 
	var x=document.forms["reg"]["username"].value;
	var y=document.forms["reg"]["password"].value;
	var z=document.forms["reg"]["repassword"].value;
	var e1=document.forms["reg"]["email"].value;

	if (x==null || x=='' || y==null || y=='' || e1 ==null || e1 =='')
	{  
		alert("Bạn cần điền đầy đủ thông tin");  
		
		return false;
	}
	if(y != z)
	{
		alert("Mật khẩu không giống nhau.");  
		
		return false;	
	}
	if(y == '123456' || y == '123'|| y == 'admin' || y == '111111')
	{
		alert("Mật khẩu không an toàn. Vui lòng đặt lại mật khẩu khác.");  
		
		return false;	
	}
	return true;
	
}
</script>